package 一些笔试真题;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-10-06
 * Time: 15:02
 */

/*
    求表达式f(n)结果末尾0的个数
    本题可以转化为找出因子5的个数即可
 */
public class xiaohongshu_1 {
    private static int calNumber(int num, int n){
        int cnt = 0;
        while(num >= n && num % n == 0){
            cnt++;
            num /= n;
        }
        return cnt;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for(int i = 1; i <= n; i++){
            res += calNumber(i, 5) * (n + 1 - i);
        }
        System.out.println(res);
    }
}
